package cp2013;

import java.io.Serializable;

/**
 *
 * @author AcerXPS
 */
public class User implements Serializable {

    private int userID;
    private String username;
    private String password;
    private String fName;
    private String lName;
    private String dob;
    private String address;
    private String eMail;
    private int token;

    public User(String username, int token, int userID){
        //for current user
        this.username = username;
        this.token = token;
        this.userID = userID;
    }

    public User(String username, String password, String fName, String lName, String dob, String address, String eMail){
        //for new user
        this.username = username;
        this.password = password;
        this.fName = fName;
        this.lName = lName;
        this.dob = dob;
        this.address = address;
        this.eMail = eMail;
        this.token = 5;
    }
    /**
     * @return the username
     */
    public String getUsername() {
        return username;
    }

    @Override
    public String toString(){
        return username+";"+token+";"+password+";"+fName+";"+lName+";"+dob+";"+address+";"+eMail;
    }

    public String loginString(){
        return username+";"+token+";"+userID;
    }
    /**
     * @return the token
     */
    public int getToken() {
        return token;
    }

    /**
     * @return the password
     */
    public String getPassword() {
        return password;
    }

    /**
     * @return the fName
     */
    public String getfName() {
        return fName;
    }

    /**
     * @return the lName
     */
    public String getlName() {
        return lName;
    }

    /**
     * @return the DOB
     */
    public String getDob() {
        return dob;
    }

    /**
     * @return the address
     */
    public String getAddress() {
        return address;
    }

    /**
     * @return the eMail
     */
    public String geteMail() {
        return eMail;
    }

    /**
     * @return the userID
     */
    public int getUserID() {
        return userID;
    }

    /**
     * @param userID the userID to set
     */
    public void setUserID(int userID) {
        this.userID = userID;
    }

    /**
     * @param bid the token to set
     */
    public void decrementToken(int bid) {
        this.token -= bid;
    }

    public void incrementToken(int rechargeAmt) {
        this.token += rechargeAmt;
    }


}
